/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package CarProject.impl;

import CarProject.Ajouter;
import CarProject.Action;
import CarProject.CarProjectPackage;
import CarProject.Lister;
import CarProject.Modifier;
import CarProject.Supprimer;
import CarProject.Table;
import CarProject.VueBD;
import CarProject.VueFormulaire;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Vue Formulaire</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link CarProject.impl.VueFormulaireImpl#getPossede <em>Possede</em>}</li>
 *   <li>{@link CarProject.impl.VueFormulaireImpl#getPossedeAction <em>Possede Action</em>}</li>
 *   <li>{@link CarProject.impl.VueFormulaireImpl#getPossedeList <em>Possede List</em>}</li>
 *   <li>{@link CarProject.impl.VueFormulaireImpl#getPossedeSupprimer <em>Possede Supprimer</em>}</li>
 *   <li>{@link CarProject.impl.VueFormulaireImpl#getPossedeAjouter <em>Possede Ajouter</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class VueFormulaireImpl extends VueGeneraleImpl implements VueFormulaire {
	/**
	 * The cached value of the '{@link #getPossede() <em>Possede</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPossede()
	 * @generated
	 * @ordered
	 */
	protected Table possede;

	/**
	 * The cached value of the '{@link #getPossedeAction() <em>Possede Action</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPossedeAction()
	 * @generated
	 * @ordered
	 */
	protected Modifier possedeAction;

	/**
	 * The cached value of the '{@link #getPossedeList() <em>Possede List</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPossedeList()
	 * @generated
	 * @ordered
	 */
	protected Lister possedeList;

	/**
	 * The cached value of the '{@link #getPossedeSupprimer() <em>Possede Supprimer</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPossedeSupprimer()
	 * @generated
	 * @ordered
	 */
	protected Supprimer possedeSupprimer;

	/**
	 * The cached value of the '{@link #getPossedeAjouter() <em>Possede Ajouter</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPossedeAjouter()
	 * @generated
	 * @ordered
	 */
	protected Ajouter possedeAjouter;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected VueFormulaireImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return CarProjectPackage.Literals.VUE_FORMULAIRE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Table getPossede() {
		if (possede != null && possede.eIsProxy()) {
			InternalEObject oldPossede = (InternalEObject)possede;
			possede = (Table)eResolveProxy(oldPossede);
			if (possede != oldPossede) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CarProjectPackage.VUE_FORMULAIRE__POSSEDE, oldPossede, possede));
			}
		}
		return possede;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Table basicGetPossede() {
		return possede;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPossede(Table newPossede) {
		Table oldPossede = possede;
		possede = newPossede;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE, oldPossede, possede));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Modifier getPossedeAction() {
		return possedeAction;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetPossedeAction(Modifier newPossedeAction, NotificationChain msgs) {
		Modifier oldPossedeAction = possedeAction;
		possedeAction = newPossedeAction;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION, oldPossedeAction, newPossedeAction);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPossedeAction(Modifier newPossedeAction) {
		if (newPossedeAction != possedeAction) {
			NotificationChain msgs = null;
			if (possedeAction != null)
				msgs = ((InternalEObject)possedeAction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION, null, msgs);
			if (newPossedeAction != null)
				msgs = ((InternalEObject)newPossedeAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION, null, msgs);
			msgs = basicSetPossedeAction(newPossedeAction, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION, newPossedeAction, newPossedeAction));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Lister getPossedeList() {
		return possedeList;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetPossedeList(Lister newPossedeList, NotificationChain msgs) {
		Lister oldPossedeList = possedeList;
		possedeList = newPossedeList;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST, oldPossedeList, newPossedeList);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPossedeList(Lister newPossedeList) {
		if (newPossedeList != possedeList) {
			NotificationChain msgs = null;
			if (possedeList != null)
				msgs = ((InternalEObject)possedeList).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST, null, msgs);
			if (newPossedeList != null)
				msgs = ((InternalEObject)newPossedeList).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST, null, msgs);
			msgs = basicSetPossedeList(newPossedeList, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST, newPossedeList, newPossedeList));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Supprimer getPossedeSupprimer() {
		return possedeSupprimer;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetPossedeSupprimer(Supprimer newPossedeSupprimer, NotificationChain msgs) {
		Supprimer oldPossedeSupprimer = possedeSupprimer;
		possedeSupprimer = newPossedeSupprimer;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER, oldPossedeSupprimer, newPossedeSupprimer);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPossedeSupprimer(Supprimer newPossedeSupprimer) {
		if (newPossedeSupprimer != possedeSupprimer) {
			NotificationChain msgs = null;
			if (possedeSupprimer != null)
				msgs = ((InternalEObject)possedeSupprimer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER, null, msgs);
			if (newPossedeSupprimer != null)
				msgs = ((InternalEObject)newPossedeSupprimer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER, null, msgs);
			msgs = basicSetPossedeSupprimer(newPossedeSupprimer, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER, newPossedeSupprimer, newPossedeSupprimer));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Ajouter getPossedeAjouter() {
		return possedeAjouter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetPossedeAjouter(Ajouter newPossedeAjouter, NotificationChain msgs) {
		Ajouter oldPossedeAjouter = possedeAjouter;
		possedeAjouter = newPossedeAjouter;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER, oldPossedeAjouter, newPossedeAjouter);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPossedeAjouter(Ajouter newPossedeAjouter) {
		if (newPossedeAjouter != possedeAjouter) {
			NotificationChain msgs = null;
			if (possedeAjouter != null)
				msgs = ((InternalEObject)possedeAjouter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER, null, msgs);
			if (newPossedeAjouter != null)
				msgs = ((InternalEObject)newPossedeAjouter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER, null, msgs);
			msgs = basicSetPossedeAjouter(newPossedeAjouter, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER, newPossedeAjouter, newPossedeAjouter));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION:
				return basicSetPossedeAction(null, msgs);
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST:
				return basicSetPossedeList(null, msgs);
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER:
				return basicSetPossedeSupprimer(null, msgs);
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER:
				return basicSetPossedeAjouter(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE:
				if (resolve) return getPossede();
				return basicGetPossede();
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION:
				return getPossedeAction();
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST:
				return getPossedeList();
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER:
				return getPossedeSupprimer();
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER:
				return getPossedeAjouter();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE:
				setPossede((Table)newValue);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION:
				setPossedeAction((Modifier)newValue);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST:
				setPossedeList((Lister)newValue);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER:
				setPossedeSupprimer((Supprimer)newValue);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER:
				setPossedeAjouter((Ajouter)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE:
				setPossede((Table)null);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION:
				setPossedeAction((Modifier)null);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST:
				setPossedeList((Lister)null);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER:
				setPossedeSupprimer((Supprimer)null);
				return;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER:
				setPossedeAjouter((Ajouter)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE:
				return possede != null;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_ACTION:
				return possedeAction != null;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_LIST:
				return possedeList != null;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_SUPPRIMER:
				return possedeSupprimer != null;
			case CarProjectPackage.VUE_FORMULAIRE__POSSEDE_AJOUTER:
				return possedeAjouter != null;
		}
		return super.eIsSet(featureID);
	}

} //VueFormulaireImpl
